Integrand size = 32, antiderivative size = 62 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx=-\frac {(i A-B) x}{2 a}+\frac {A \log (\sin (c+d x))}{a d}+\frac {A+i B}{2 d (a+i a \tan (c+d x))} \]
Time = 0.82 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.39 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx=-\frac {(3 A+i B) \log (i-\tan (c+d x))-4 A \log (\tan (c+d x))+(A-i B) \log (i+\tan (c+d x))+\frac {2 i (A+i B)}{-i+\tan (c+d x)}}{4 a d} \]
-1/4*((3*A + I*B)*Log[I - Tan[c + d*x]] - 4*A*Log[Tan[c + d*x]] + (A - I*B )*Log[I + Tan[c + d*x]] + ((2*I)*(A + I*B))/(-I + Tan[c + d*x]))/(a*d)
Time = 0.42 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.08, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {3042, 4079, 3042, 4014, 3042, 25, 3956}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \tan (c+d x)}{\tan (c+d x) (a+i a \tan (c+d x))}dx\) |
\(\Big \downarrow \) 4079 |
\(\displaystyle \frac {\int \cot (c+d x) (2 a A-a (i A-B) \tan (c+d x))dx}{2 a^2}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {2 a A-a (i A-B) \tan (c+d x)}{\tan (c+d x)}dx}{2 a^2}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle \frac {2 a A \int \cot (c+d x)dx-a x (-B+i A)}{2 a^2}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 a A \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx-a x (-B+i A)}{2 a^2}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {-2 a A \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx-a x (-B+i A)}{2 a^2}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {\frac {2 a A \log (-\sin (c+d x))}{d}-a x (-B+i A)}{2 a^2}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}\) |
(-(a*(I*A - B)*x) + (2*a*A*Log[-Sin[c + d*x]])/d)/(2*a^2) + (A + I*B)/(2*d *(a + I*a*Tan[c + d*x]))
3.1.40.3.1 Defintions of rubi rules used
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a *d)/(a^2 + b^2) Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && N eQ[a*c + b*d, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[(a*A + b*B)*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(2*f*m*( b*c - a*d))), x] + Simp[1/(2*a*m*(b*c - a*d)) Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[A*(b*c*m - a*d*(2*m + n + 1)) + B*(a*c*m - b*d*(n + 1)) + d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x], x], x], x] /; Free Q[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0] && !GtQ[n, 0]
Time = 0.14 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.37
method | result | size |
risch | \(\frac {x B}{2 a}-\frac {3 i x A}{2 a}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} B}{4 a d}+\frac {{\mathrm e}^{-2 i \left (d x +c \right )} A}{4 a d}-\frac {2 i A c}{a d}+\frac {A \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a d}\) | \(85\) |
derivativedivides | \(-\frac {A \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d a}-\frac {i A \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}+\frac {B \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}-\frac {i A}{2 d a \left (\tan \left (d x +c \right )-i\right )}+\frac {B}{2 d a \left (\tan \left (d x +c \right )-i\right )}+\frac {A \ln \left (\tan \left (d x +c \right )\right )}{a d}\) | \(111\) |
default | \(-\frac {A \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d a}-\frac {i A \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}+\frac {B \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}-\frac {i A}{2 d a \left (\tan \left (d x +c \right )-i\right )}+\frac {B}{2 d a \left (\tan \left (d x +c \right )-i\right )}+\frac {A \ln \left (\tan \left (d x +c \right )\right )}{a d}\) | \(111\) |
norman | \(\frac {\frac {i B +A}{2 a d}+\frac {\left (-i A +B \right ) x}{2 a}+\frac {\left (-i A +B \right ) \tan \left (d x +c \right )}{2 a d}+\frac {\left (-i A +B \right ) x \left (\tan ^{2}\left (d x +c \right )\right )}{2 a}}{1+\tan ^{2}\left (d x +c \right )}+\frac {A \ln \left (\tan \left (d x +c \right )\right )}{a d}-\frac {A \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d a}\) | \(117\) |
1/2*x/a*B-3/2*I*x/a*A+1/4*I/a/d*exp(-2*I*(d*x+c))*B+1/4/a/d*exp(-2*I*(d*x+ c))*A-2*I*A/a/d*c+A/a/d*ln(exp(2*I*(d*x+c))-1)
Time = 0.25 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.10 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx=-\frac {{\left (2 \, {\left (3 i \, A - B\right )} d x e^{\left (2 i \, d x + 2 i \, c\right )} - 4 \, A e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) - A - i \, B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \]
-1/4*(2*(3*I*A - B)*d*x*e^(2*I*d*x + 2*I*c) - 4*A*e^(2*I*d*x + 2*I*c)*log( e^(2*I*d*x + 2*I*c) - 1) - A - I*B)*e^(-2*I*d*x - 2*I*c)/(a*d)
Time = 0.20 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.87 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx=\frac {A \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} + \begin {cases} \frac {\left (A + i B\right ) e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: a d e^{2 i c} \neq 0 \\x \left (- \frac {- 3 i A + B}{2 a} + \frac {\left (- 3 i A e^{2 i c} - i A + B e^{2 i c} + B\right ) e^{- 2 i c}}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {x \left (- 3 i A + B\right )}{2 a} \]
A*log(exp(2*I*d*x) - exp(-2*I*c))/(a*d) + Piecewise(((A + I*B)*exp(-2*I*c) *exp(-2*I*d*x)/(4*a*d), Ne(a*d*exp(2*I*c), 0)), (x*(-(-3*I*A + B)/(2*a) + (-3*I*A*exp(2*I*c) - I*A + B*exp(2*I*c) + B)*exp(-2*I*c)/(2*a)), True)) + x*(-3*I*A + B)/(2*a)
Exception generated. \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx=\text {Exception raised: RuntimeError} \]
Time = 0.43 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.56 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx=-\frac {\frac {{\left (A - i \, B\right )} \log \left (\tan \left (d x + c\right ) + i\right )}{a} + \frac {{\left (3 \, A + i \, B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a} - \frac {4 \, A \log \left (\tan \left (d x + c\right )\right )}{a} - \frac {3 \, A \tan \left (d x + c\right ) + i \, B \tan \left (d x + c\right ) - 5 i \, A + 3 \, B}{a {\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \]
-1/4*((A - I*B)*log(tan(d*x + c) + I)/a + (3*A + I*B)*log(tan(d*x + c) - I )/a - 4*A*log(tan(d*x + c))/a - (3*A*tan(d*x + c) + I*B*tan(d*x + c) - 5*I *A + 3*B)/(a*(tan(d*x + c) - I)))/d
Time = 7.98 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.58 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx=\frac {\frac {A}{2\,a}+\frac {B\,1{}\mathrm {i}}{2\,a}}{d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}+\frac {A\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (3\,A+B\,1{}\mathrm {i}\right )}{4\,a\,d} \]